package com.nameless.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author chh
 * @since 2023-02-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_coupon")
@ApiModel(value="Coupon对象", description="")
public class Coupon implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "店面id")
    private Long shopId;

    @ApiModelProperty(value = "优惠卷类型")
    private Integer type;

    private String name;

    @ApiModelProperty(value = "使用平台：0->全部；1->移动；2->PC")
    private Integer platform;

    @ApiModelProperty(value = "满减额度")
    private BigDecimal originCondition;

    @ApiModelProperty(value = "满减金额")
    private BigDecimal denominations;

    @ApiModelProperty(value = "折扣")
    private BigDecimal discount;

    @ApiModelProperty(value = "金额")
    private BigDecimal value;

    @ApiModelProperty(value = "每人限领张数")
    private Integer perLimit;

    @ApiModelProperty(value = "使用门槛；0表示无门槛")
    private Integer minPoint;

    @ApiModelProperty(value = "车辆id")
    private String carId;

    @ApiModelProperty(value = "类型id")
    private String typeId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @ApiModelProperty(value = "使用类型：0->全场通用；1->指定分类；2->指定车辆")
    private Integer useType;

    @ApiModelProperty(value = "备注")
    private String description;

    @ApiModelProperty(value = "不可用原因，优惠券不可用时展示")
    private String reason;

    @ApiModelProperty(value = "发行数量")
    private Integer publishCount;

    @ApiModelProperty(value = "已使用数量")
    private Integer useCount;

    @ApiModelProperty(value = "领取数量")
    private Integer receiveCount;

    @ApiModelProperty(value = "开始可以领取的日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date enableTime;

    @ApiModelProperty(value = "优惠码")
    private String code;

    @ApiModelProperty(value = "可领取的会员类型：0->无限时")
    private Integer memberLevel;

    @ApiModelProperty(value = "折扣券优惠金额文案")
    private String valueDesc;

    @ApiModelProperty(value = "单位文案")
    private String unitDesc;

    @ApiModelProperty(value = "类型")
    @TableField(exist = false)
    private CouponType couponType;

    @TableField(exist = false)
    private Long startAt;

    @TableField(exist = false)
    private Long endAt;


}
